const express = require('express')

const app = express()

// 定义一个中间件
const middleFun = function (req, res, next) {
    console.log('这是局部中间件');
    next()
}

// 定义第二个中间件
const middleFunTwo = function (req, res, next) {
    console.log("这是第二个局部中间件");
    next()
}

app.get('/', middleFun, middleFunTwo, function (req, res) {
    res.send('Home Page')
})

app.get('/', [middleFun, middleFunTwo], function (req, res) {
    res.send('Home Page')
})

app.get('/user', function (req, res) {
    res.send('user page')
})

app.listen(80, () => {
    console.log("server runing at http://127.0.0.1");
})